/*
*  Copyright 2019-2023 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.base.BaseEntity;
import me.zhengjie.modules.system.domain.dto.TeskandreadDto;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;

/**
* @description /
* @author shitou
* @date 2024-05-23
**/
@Data
@TableName("tesk")
public class Tesk implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Integer id;

    @ApiModelProperty(value = "name")
    private String name;

    @ApiModelProperty(value = "createtime")
    private String createtime;

    @ApiModelProperty(value = "endtime")
    private String endtime;

    @ApiModelProperty(value = "type")
    private Integer type;

    @ApiModelProperty(value = "info")
    private String info; //信息

    @ApiModelProperty(value = "remark")
    private String remark; //备注简介

    @ApiModelProperty(value = "lastupdatetime")
    @TableField(fill = FieldFill.INSERT)
    private Integer lastupdatetime;

    @TableField(exist = false)
    private Long courseId;

    @TableField(exist = false)
    private List<Integer> clazzIds;

    @TableField(exist = false)
    private String content; //内容

    @TableField(exist = false)
    private List<TeskandreadDto> teachArrId; //教材


    @TableField(exist = false)
    private List<String> resourceArrId; //资源

    @TableField(exist = false)
    private List<Resource> resourceArr;

    @TableField(exist = false)
    private List<Integer> exerciseSetArrId; //习题集

    @TableField(exist = false)
    private Integer state; //状态

//    @TableField(exist = false)
//    private Integer teachChapterId;
//
//    @TableField(exist = false)
//    private Integer teachSubsectionId;
    @TableField(exist = false)
    private Integer studentCount;

    @TableField(exist = false)
    private Integer completedCount;

    private Integer schoolId;

    @TableField(fill = FieldFill.INSERT)
    private Timestamp createBy;

    public void copy(Tesk source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
